package com.example.entity;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Builder;
import lombok.Data;
import lombok.experimental.Tolerate;

import java.io.Serializable;


@Data
@Builder
@TableName("tb_employee")
public class Employee extends Model<Employee> {

    @Tolerate
    public Employee() { 
        
    }

    @TableId(type = IdType.AUTO)
    private Integer id;
    
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String lastName;
    
    @TableField(select = false)
    private String email;
    
    private Integer gender;
    
    @TableField(value = "age")
    private Integer age;
    
    @TableField(exist = false)
    private String address;
    
    private String firstName;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}
